﻿using System;
using System.Collections.Generic;
using MEF_Test.Contracts;

namespace MEF_Test.Subtitles
{
    public interface ISubtitlesSelectionPageViewModel
    {
        /// <summary>
        /// Fetches the subtitles for the specified node.
        /// </summary>
        void FetchSubtitles();

        IFileHandler FileHandler { get; set; }

        event SubtitleSelectionValidatedHandler SubtitleSelectionValidated;
    }

    public delegate void SubtitleSelectionValidatedHandler(object sender, SubtitleSelectionValidatedArgs args);

    public class SubtitleSelectionValidatedArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SubtitleSelectionValidatedArgs"/> class.
        /// </summary>
        /// <param name="browserNodeViewModel">The browser node view model.</param>
        /// <param name="selectedSubtitle">The selected subtitle.</param>
        public SubtitleSelectionValidatedArgs(IBrowserNodeViewModel browserNodeViewModel, ISubtitleHandler selectedSubtitle)
        {
            BrowserNodeViewModel = browserNodeViewModel;
            SelectedSubtitle = selectedSubtitle;
        }

        /// <summary>
        /// Gets or sets the selected subtitle.
        /// </summary>
        /// <value>The subtitles selection coming from the Subtitles Selection View.</value>
        public ISubtitleHandler SelectedSubtitle { get; set; }

        public IBrowserNodeViewModel BrowserNodeViewModel { get; set; }
    }
}
